import threading
import time

def target():
    print('the curent threading  %s is running' % threading.current_thread().name)
    time.sleep(1)
    print('the curent threading  %s is ended' % threading.current_thread().name)

print('the curent threading  %s is running' % threading.current_thread().name)
t = threading.Thread(target=target)

#t.setDaemon(True) #1 要使主线程退出，子线程也退出，只需要把子线程设置为daemon
t.start()
#t.join() #2
print('the curent threading  %s is ended' % threading.current_thread().name)